/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.tmd.controlefinanceiro.persistence;

import br.com.tmd.controlefinanceiro.modelo.Despesa;
import br.com.tmd.controlefinanceiro.util.HibernateUtil;
import java.util.List;

/**
 *
 * @author Cícero
 */
public class DespesaDao extends GenericDao<Despesa>{
    
    public DespesaDao() {
        super(new Despesa());
    }
    
    public List<Despesa> listaDespesas(){
        session = HibernateUtil.getSessionFactory().openSession();
        criteria = session.createCriteria(Despesa.class);
        List<Despesa> lista = criteria.list();
        
        session.close();
        return lista;
            
    }
    
}
